package cn.zijitc.web;

import cn.zijitc.service.DingDingService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "markdown", value = "/markdown")
public class markdown extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setCharacterEncoding("UTF-8");
        String message=request.getParameter("message");
        message = new String(message.getBytes("ISO-8859-1"), "UTF-8");
        String token=request.getParameter("token");
        token=new String(token.getBytes("ISO-8859-1"), "UTF-8");
        String whois=request.getParameter("whois");
        whois=new String(whois.getBytes("ISO-8859-1"), "UTF-8");
        String phone=request.getParameter("phone");
        phone=new String(phone.getBytes("ISO-8859-1"), "UTF-8");
        DingDingService service=new DingDingService();
        service.gomarkdown(message,token,whois,phone);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    this.doGet(request, response);
    }
}
